(1) Field of the Invention
The present invention relates to a lead-bend measuring apparatus for measuring an amount of bend of leads projecting from a package of an integrated circuit device (hereafter simply referred to as an "IC") so as to determine the non-defective or defective state of the product by comparing the measured results with allowable values.
(2) Description of the Related Art
FIG. 1 is a block diagram of a lead-bend measuring apparatus which shows a conventional example. As shown in the drawings, the lead-bend measuring apparatus of this type conventionally comprises an inspection stage 38 on Which an IC 2 is placed with its rear surface facing up by means of clamp claws 3a, 3b and 3c; a pair of annular incandescent lamps 4a for projecting light onto distal ends, proximal ends, and apex portions of the leads of the IC 2 as well as a pair of optical fiber arrays 4b connected to an incandescent lamp-house; a pair of camera heads 1, a camera driver 10, and a camera controller 11 for fetching the light reflected from and transmitted through the leads and for imaging the distal ends, proximal ends, and apex portions of the leads; an A/D converter 13 for fetching image signals from the camera controller 11 by means of a fetch clock 12 and converting the same into 256 gradations; a frame memory 15 for storing the image data converted into 256 gradations; a CPU 23 adapted to fetch the image data from the frame memory 15, divide the fetched image data into a plurality of sections, binarize the image data of the divided sections, prepare a profile of various lead portions by means of this binarized data and calculate a deviation of that profile from a reference profile to determine an amount of bend of each lead, and compare this amount of bend with allowable values so as to determine the non-defective or defective state; a printer 29, a CRT 28, a keyboard 27, and an external storage device 26 for storing the allowable values and the like, all of these units being connected to the CPU 23 via I/O ports 14f; a binary image memory 18 for temporarily storing the image data subjected to binarization processing by the CPU 23; a feeding section 6 for feeding ICs 2; a horizontal transport mechanism section 5 for transporting the ICs to a non-defective storing section 7 or a defective storing section 8 after the non-defective or defective state of the ICs is determined by the CPU 23; and a sequencer 9 for controlling the various units.
The CPU 23 comprises an area cutout unit 16 for fetching the image data of the entire imaged regions of the leads of the IC 2 from the frame memory 15 via I/O ports 14b, and for dividing the fetched image data into a plurality of divided regions designated by area-designating-pointer storage units 19a; a binarization processing unit 17 for binarizing the image data of the entire divided sections at a binarization level stored in advance in a binarization-level storage unit 20a, and for storing the binarized data in the binary image memory 18 connected to an external device via I/O ports 14d; a profile counter 21 for fetching the binarized data from the binary image memory 18 via I/O ports 14e and preparing an image profile of the leads; an area center-of-gravity calculating unit 22 for calculating the center of gravity of an area of the prepared profile; a lead-bend-amount calculating unit 25 for calculating a deviation of the center of gravity of the area from a reference profile position so as to obtain an amount of bend; and a non-defective/defective determining unit 24 for determining the non-defective or detective state by comparing this amount of bend and allowable values stored in advance.
Next, a description will be given of the operation of this lead-bend measuring apparatus. First, the IC 2 is fed from the feeding section 6 to the inspection stage 38, and the IC 2 is placed on the inspection stage 38 with its rear surface facing up. The IC 2 is then fixed to the inspection stage 38 by means of the clamp claws 3a, 3b and 3c. Subsequently, light is projected onto the distal ends, proximal ends, and apex portions of the leads by means of the annular incandescent lamps 4a and the optical fiber arrays 4b. The camera heads 1 fetch the light reflected from or transmitted through the various portions of the leads and effect imaging. The camera controller 11 fetches imaging signals by means of the fetch clock 12, and the imaging signals are divided into 256 gradations by the A/D converter 13 and are stored in the frame memory 15. The area cutout unit 16 then divides all the image data of the frame memory 15 into a plurality of designated sections stored in advance in the area-designating-pointer storage units 19a. Subsequently, the binarization processing unit 17 effects binarization processing of all the image data of the areas divided by using one binarization level which is set in advance in the binarization-level storage unit 20a. The image data subjected to binarization processing is temporarily stored in the binary image memory 18. The profile counter 21 fetches the image data from the binary image memory 18 through the I/O ports 14e and prepares profiles of various portions of the leads.
A description will now be given of a method of calculating an amount of bend of each lead from the profiles of the various portions of the leads. FIG. 2 is a diagram illustrating an algorithm for calculating an amount of bend in the lead-bend measuring apparatus shown in FIG. 1. FIGS. 3A to 3C are flow-charts illustrating the algorithm. If it is assumed that the profile of each portion is depicted as shown in FIG. 2, in Step 310 of FIG. 3A, WINDOWs 1 and 2 shown in FIG. 2 are set by the area center-of-gravity calculating unit 22 and the lead-bend-amount calculating unit 25. Then, points a, b, c and d at which defining lines of the WINDOWs 1 and 2 and contour lines of the profile intersect each other are determined in Step 320. In Step 330, mid-points between the respective pairs of points of intersection are determined and set as WG1 and WG2. In Step 340, an angle .theta. of inclination of the profile, i.e., an angle of bend, is determined from X-Y coordinate values of WG1 and WG2. In Step 350, coordinates of a mid-point STP at one end of the profile are determined. Here, the coordinates of STP are calculated as shown in FIG. 3B. Namely, in Step 351 of FIG. 3B, a segment is extended from WG1 in parallel with the Y-axis. Then, in Step 352, the length of a segment A between the point WG1 and a point WG1VP is calculated. A segment B is determined from the segment A in Step 353. Then, the coordinates of STP are calculated in Step 354.
Subsequently, in Step 360 of FIG. 3A, coordinate values of a mid-point SBP at the other end of the profile are determined in a similar manner in accordance with the flow-chart shown in FIG. 3C. Then, in Step 370 of FIG. 3A, the difference between the X-axis components of the mid-points STP and SBP is calculated as the amount of bend.
Next, in the non-defective/defective determining unit 24, allowable values of bend stored in advance in the external storage unit 26 are extracted, and a comparison is made between the same and the calculated amount of bend so as to determine the non-defective or defective state. Then, the horizontal transport mechanism section 5 is actuated by the sequencer 9, and the IC 2 whose non-defective or detective state has been determined is stored in the non-defective storage section 7 or the defective storage section 8. The inspection of the bend of IC leads has hitherto been effected automatically in the above-described manner.
However, since the lead of the IC is complicated in shape, and the finished state of the surfaces of the leads is not necessarily uniform, it is impossible to obtain uniform intensity of light reflected from the various portions of the leads. As a result, the visibility of the projected images of various portions of the leads differs for each section, which in turn results in measurement errors, making it difficult to effect accurate measurement.
FIGS. 4A to 4F are diagrams for explaining the problems in the conventional lead-bend measuring apparatus, in which FIGS. 4A to 4D are graphs illustrating the distribution of illuminance at gradations, and FIGS. 4E and 4F are diagrams illustrating the positions of sections in the leads. A description will now be given of the aforementioned problems with reference to the drawings. For instance, as shown in FIGS. 4E and 4F, if leads 39 are illuminated with light at sections 35a, 35b, 35c and 35d, the distribution of illuminance differs for each of these sections, as shown in FIGS. 4A to 4D. Here, the sections 35a and 35b are imaged by one camera, and the sections 35c and 35d are imaged by another. With the conventional lead-bend measuring apparatus, since the binarization processing of the image data of all of these sections is performed at only one binarization level, not all the sections exhibit the same visibility. That is, as for the distribution of illuminance in the sections 35b and 35d respectively shown in FIGS. 4B and 4D, peaks are located closer to the high gradation side with gradation 128 in the binarization processing level serving as a boundary, so that images of the same illuminance are obtained when the image data is processed at the same binarization level. However, in a case where the distribution of illuminance utterly differs in the sections 35a and 35c respectively shown in FIGS. 4A and 4C, if the image data is processed at the same binarization level, it,is impossible to obtain clear binarized images thereof. In other words, in the image subjected to binarization processing, an area which should essentially be recognized as a bright spot is recognized as a dark spot. That is, the imaged portion of the lead is recognized as an image which is more reduced than the actual size. Hence, there is a problem in that if the bend of the lead is calculated in accordance with the above-described algorithm, the lead bend is measured as being smaller than the actual lead bend, thereby giving rise to an erroneous determination in the determination of the non-defective or defective state. This is a problem in the conventional lead-bend measuring apparatus, to be solved by the invention.